package com.zib.bilibili.presenter;

import android.util.Log;

import com.zib.bilibili.base.BasePresenter;
import com.zib.bilibili.bean.LiveBean;
import com.zib.bilibili.model.ModelFactory;
import com.zib.bilibili.view.ILiveView;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by Administrator on 2016/7/6.
 */
public class LivePresenter extends BasePresenter<ILiveView> {
    public void getLiveData(){
        ModelFactory.getFindModel().getLiveData(new Callback<LiveBean>() {
            @Override
            public void onResponse(Call<LiveBean> call, Response<LiveBean> response) {
                LiveBean liveBean = response.body();

                Log.i("success", "---onsuccess: 奥"+liveBean.getData().getEntranceIcons().size());

                if(liveBean!=null){
                    getView().onSuccess(liveBean);
                }
            }

            @Override
            public void onFailure(Call<LiveBean> call, Throwable t) {
                Log.i("success", "---onFailure: 我给你说啊,网络访问失败了");
            }
        });
    }
}
